<!-- 调拨 -->
<template>
  <div>
    <h4>调拨记录</h4>
    <el-table v-loading="loading" :data="noticeList">
      <el-table-column label="序号" align="center" min-width="50">
        <template slot-scope="scope">
          {{ scope.$index + 1 }}
        </template>
      </el-table-column>
      <el-table-column label="调拨编号" align="center" min-width="130">
        <template slot-scope="scope">
          {{ scope.row.allocationNum || '-' }}
        </template>
      </el-table-column>
      <el-table-column label="申请时间" align="center" min-width="150">
        <template slot-scope="scope">
          {{ scope.row.applicationTime || '-' }}
        </template>
      </el-table-column>

      <el-table-column label="申请人" align="center" min-width="130">
        <template slot-scope="scope">
          {{ scope.row.applicantName || '-' }}
        </template>
      </el-table-column>
      <el-table-column label="调出部门" align="center" min-width="130">
        <template slot-scope="scope">
          <span v-for="(item, index) in scope.row.allocationEquipmentAccountVos" :key="index" show-overflow-tooltip>
            {{ item.oldDeptName || '-' }}
          </span>/
        </template>
      </el-table-column>
      <el-table-column label="调出地点" align="center" min-width="130">
        <template slot-scope="scope">
          <span v-for="(item, index) in scope.row.allocationEquipmentAccountVos" :key="index" show-overflow-tooltip>
            {{ item.oldPlaceName || '-' }}
          </span>/
        </template>
      </el-table-column>
      <el-table-column label="原负责人" align="center" min-width="130">
        <template slot-scope="scope">
          <span v-for="(item, index) in scope.row.allocationEquipmentAccountVos" :key="index" show-overflow-tooltip>
            {{ item.oldHeadName || '-' }}
          </span>/
        </template>
      </el-table-column>
      <el-table-column label="调入部门" align="center" min-width="120">
        <template slot-scope="scope">
          {{ scope.row.deptName || '-' }}
        </template>
      </el-table-column>
      <el-table-column label="调入地点" align="center" min-width="120">
        <template slot-scope="scope">
          {{ scope.row.placeName || '-' }}
        </template>
      </el-table-column>
      <el-table-column label="新负责人" align="center" min-width="120">
        <template slot-scope="scope">
          {{ scope.row.headName || '-' }}
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" min-width="150" show-overflow-tooltip>
        <template slot-scope="scope">
          {{ scope.row.remark || '-' }}
        </template>
      </el-table-column>
    </el-table>
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />
  </div>
</template>

<script>
import { getallocationlist } from "@/api/equipment/equipment.js";
export default {
  name: 'transfer',
  props: ['rowObj'],
  data () {
    return {
      total: 0,
      loading: false,
      noticeList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        orderByColumn: 'allocationId',
        isAsc: 'desc'//倒叙
      },
    }
  },
  created () {
    this.getList();
  },
  methods: {
    async getList () {
      this.loading = true
      let params = {
        ...this.queryParams,
        'params[equipmentAccountId]': this.rowObj.equipmentAccountId
      }
      let data = await getallocationlist(params);
      this.total = data.total
      this.noticeList = data.data
      this.loading = false
    },
  }
}
</script>

<style>
</style>